import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

const api = apiCreator();

export default {
  // 查询角色配置列表
  Search: (query) => api.get(`gateway/portfolio-server/role/condition`, query),
  // 获取用户下拉数据
  SearchUser: (query) => api.get(`gateway/portfolio-server/user/findAll`, query),
  // 根据角色ID，获取角色的菜单
  getMenuByRoleId: (query) => api.get(`gateway/portfolio-server/role/getMenuById`, query),
  // 获取关联菜单数据
  SearchMenu: (query) => api.get(`gateway/portfolio-server/menu/findAll`, query),
  // 编辑时获取关联菜单数据
  SearchMenu2: (query) => api.post(`gateway/portfolio-server/menu/findAll2`, query),
  // 新增编辑角色配置
  saveTable: (query) => api.post(`gateway/portfolio-server/role/add`, query),
  // 删除角色
  deleteRole: (query) => api.post(`gateway/portfolio-server/role/remove`, query),
};
